<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户管理后台系统 - 登录</title>

    <link rel="stylesheet" href="/layui/css/layui.css">

</head>
<body style="background-color:lightblue">
<div class="layui-container" style="margin-top: 100px;">
    <div class="layui-row">
        <div class="layui-col-md4 layui-col-md-offset4">
            <div class="loginForm">
                <div  class="title" style="margin-bottom: 20px;font-weight: bold;"> <h1 align="center">用户管理后台系统</h1></div>
                <form class="layui-form" action="javascript:void(0);">
                    <div class="layui-form-item">
                        <div class="layui-row txt_input"  >
                            <div class="layui-col-md1 icon" style="margin-top: 10px;"> <label class="layadmin-user-login-icon layui-icon layui-icon-username"></label></div>
                            <div class="layui-col-md11">
                                <input type="text" name="username" required lay-verify="required"
                                       placeholder="请输入用户名" class="layui-input t_input">
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-row txt_input"  >
                            <div class="layui-col-md1 icon" style="margin-top: 10px;"> <label class="layadmin-user-login-icon layui-icon layui-icon-password" ></label></div>
                            <div class="layui-col-md11">
                                <input type="password" name="password" required lay-verify="required"
                                       placeholder="请输入密码" class="layui-input t_input">
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item" align="center">
                        <div class="layui-form-block">
                            <button  class="layui-btn btn_login" lay-submit lay-filter="login" style="width: 92%;margin-left: 30px;">登录</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script src="/layui/layui.js"></script>
<script>
    layui.use(['form', 'layer'],function (){
        var layer = layui.layer;
        var $ = layui.jquery;
        var form = layui.form;
        form.on('submit(login)', function(data){
            // 在这里处理登录逻辑
            $.post('/admin/loginChecked', data.field, function (res) {
                if(parseInt(res.code) === 200) {
                    window.location.href = '/admin/baseinfo/index';
                } else {
                    layer.msg(res.message);
                    return false;
                }
            }, 'json');
            return false; // 阻止表单默认提交事件
        });
    })
</script>

</body>
</html>